package com.bjc.utils.impl;

import com.bjc.utils.Cal;
import org.springframework.stereotype.Component;

/**
 * @program: airspringaop
 * @description:
 * @author: bjc
 * @create: 2020-08-30 15:04
 */
@Component
public class CalImpl implements Cal {

    public int add(int num1, int num2) {
        //System.out.println("add方法的参数是[" + num1 + "," + num2 + "]");

        //throw new RuntimeException("自定义异常");
        int result = num1 + num2;


        //System.out.println("add方法的结果是" + result);
        return result;
    }

    public int sub(int num1, int num2) {
        //System.out.println("sub方法的参数是[" + num1 + "," + num2 + "]");
        int result = num1 - num2;
        //System.out.println("sub方法的结果是" + result);
        return result;
    }

    public int mul(int num1, int num2) {
        //System.out.println("mul方法的参数是[" + num1 + "," + num2 + "]");
        int result = num1 * num2;
        //System.out.println("mul方法的结果是" + result);
        return result;
    }

    public int div(int num1, int num2) {
        //System.out.println("div方法的参数是[" + num1 + "," + num2 + "]");
        int result = num1 / num2;
        //System.out.println("div方法的结果是" + result);
        return result;
    }
}
